package com.lefevre.cms.bean;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * 返回请求结果
 *
 * @author Lefevre
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class RequestResult implements Serializable {
    private static final long serialVersionUID = 903133110511739665L;

    /**
     * 返回状态码  200:成功 500:错误
     **/
    private int code = 200;

    /**
     * 返回信息描述
     **/
    private String message = "成功";

    /**
     * 返回数据
     **/
    private Object data;

    public RequestResult(ResultCode resultCode, Object data) {
        this.code = resultCode.getCode();
        this.message = resultCode.getMessage();
        this.data = data;
    }

}
